//=============================================================================
//
// 
//
// Bodhi Crandall-Rus (boder.us)
// Sept 10, 2006
//=============================================================================

#ifndef STATICIMAGE_CPP
#define STATICIMAGE_CPP

#include "common.hpp"
#include "texture.hpp"

namespace KEG
{

class StaticImage
{
public:
	bool LoadFullImage( const std::string& str );
	void Release();
	void Render( float x, float y ) const;
	void RenderPartial( float startx, float starty, float x, float y ) const;
	void RenderPartial( float startx, float starty, float endx, float endy, float x, float y ) const;
	void RenderCentered( float totalwidth, float totalheight ) const;
	void RenderCenteredY( float x, float totalheight ) const;
	void RenderCenteredX( float y, float totalwidth ) const;
	void RenderOrigin() const;
	float Width() const { return screenWidth; }
	float Height() const { return screenHeight; }
	void Width( float w ) { screenWidth = w; }
	void Height( float h ) { screenHeight = h; }
	// temp debug
	GLfloat Tx() { return texCoord[2]; }
	GLfloat Ty() { return texCoord[3]; }
	void AddTx(int i) { texCoord[2]+=i; }
	void AddTy(int i) { texCoord[3]+=i; }
private:
	GLfloat texCoord[4];
	GLfloat screenWidth, screenHeight;
	KEG::Texture texture;
};

}
#endif
